home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / clipper / ks94an.zip / TO_PRN.HDR < prev    next >
Text File  |  1994-04-25  |  3KB  |  79 lines

  1. /******************************************************************************
  2.                  The Klipper Library, for CA-Clipper 5.x
  3.         Copyright (c), 1994, Wallace Information Systems Engineering
  4.  
  5. FUNCTION:
  6.  
  7. _To_Prn( cPrinterCodesFile, lRetryable ) --> lPrinterStatus
  8.  
  9. PARAMETERS:
  10.  
  11. cPrinterCodesFile : text file containing printer commands or codes.
  12. lRetryable        : TRUE or not specified (NIL), user can retry.
  13.                     FALSE, user cannot retry.
  14.  
  15. SHORT:
  16.  
  17. Set printer on (with optional command codes from file).
  18.  
  19. DESCRIPTION:
  20.  
  21. _To_Prn() simply set's output to printer, eliminating the need for three
  22. print redirection statements each time.
  23.  
  24. Optionally, you may specify a set of printer initialization codes by
  25. placing them in a text file and specifying that file in cPrinterCodesFile.
  26.  Each line of the file is sent to the printer "as-is" before
  27. _To_Prn() returns.  If not specified, or if invalid file, this option
  28. is ignored.
  29.  
  30. If the printer is not on-line (ie, !isprinter()) when the call to _To_Prn()
  31. is made, and lRetryable is specified and is FALSE, then the function
  32. does nothing to the settings of the _SET_PRINT, _SET_DEVICE, and
  33. _SET_CONSOLE, and immediately returns the status of the printer (FALSE).
  34.  
  35. THE PRINT SETTINGS WILL NOT HAVE BEEN AFFECTED!
  36.  
  37. If, however, the lRetryable is TRUE or NIL, then a dialogue box is
  38. invoked informing the user that the printer is offline and to turn it on.
  39.  
  40. The user is given three attempts at setting the printer on-line before
  41. the application is terminated with the message:
  42.  
  43. Printer Error During _To_Prn()
  44.  
  45. This is NOT a run-time error, but an intentional shutdown of the application.
  46.  Consequently, no debug/run-time error data is collected in the errorlog
  47. file. See _Terminate() for more information.
  48.  
  49. If the printer is properly set on-line within the three allowed attempts,
  50. then the _To_Prn() function carries on as if nothing had happened, and
  51. the settings of PRINT, DEVICE and CONSOLE are set to TRUE, "PRINT",
  52. FALSE respectively.
  53.  
  54. NOTE:
  55.  
  56. See also, HPRINTF(), _Terminate(), _LPrint()
  57.  
  58. EXAMPLE:
  59.  
  60. _To_Prn()
  61.  
  62. Result: Output is directed to the printer, and the user dialogue box
  63. is invoked of the printer is not on-line.
  64.  
  65. _To_Prn('HPITALIC.TXT')
  66.  
  67. Result: Output is directed to the printer and the printer setup codes
  68. in HPITALIC.TXT are sent to the printer one line at a time.
  69.  
  70. The user dialogue box is invoked of the printer is not on-line.
  71.  
  72. _To_Prn('HPITALIC.TXT',.F.)
  73.  
  74. Result: Same as above, but if the printer is not on line, the settings
  75. of PRINT, DEVICE, and CONSOLE are left unchanged and the function
  76. returns false.
  77.  
  78. ******************************************************************************/
  79.